﻿using SQLite;
using Color = System.Drawing.Color;

namespace HuaJiLedger.Models.Ledger;

internal class LedgerItem
{
    [PrimaryKey]
    public string Id { get; set; }
    public LedgerItemType Type { get; set; }
    /// <summary>
    /// 1 in, 0 out
    /// </summary>
    public int InOut { get; set; }
    public string DateTime { get; set; }
    public double Money { get; set; }
    public string Note { get; set; }

    public string PictureUri { get; set; }
    public string TypeStr
    {
        get => LedgerData.LedgerItemTypeStrArr[(int)Type];
    }
    public Color MoneyTextColor
    {
        get => InOut == 1 ? Color.Red : Color.Green;
    }
}